package apis.schedule;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.schedule.dtos.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-schedule")
public interface IScheduleClient {
    /**
     * 添加任务
     * @param taskDto
     * @return
     */
    @PostMapping("api/v1/task/add")
    ResponseResult add(@RequestBody TaskDto taskDto);

    /**
     * 取消任务
     * @param taskId
     * @return
     */
    @GetMapping("api/v1/task/cancelTask/{taskId}")
    ResponseResult cancelTask(@PathVariable Long taskId);

    /**
     * 取出任务
     * @param taskType
     * @param priority
     * @return
     */
    @GetMapping("api/v1/task/popTask/{taskType}/{priority}")
    ResponseResult popTask(@PathVariable Integer taskType,@PathVariable Integer priority);
}
